﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>确认订单 - {site.name}</title>
<meta name="keywords" content="{site.seo_keyword}" />
<meta name="description" content="{site.seo_description}" />
<link href="{config.webpath}css/validate.css" rel="stylesheet" type="text/css" />
<link href="<%templateskin%>/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/jquery/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/jquery/jquery.form.min.js"></script>
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/jquery/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/jquery/PCASClass.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/js/common.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/js/cart.js"></script>
<script type="text/javascript">
$(function(){
	//初始化收货地址
	initUserAddress("#userAddress");
	//初始化表单
	AjaxInitForm('#orderForm', '#btnSubmit', 0);
});
</script>
</head>

<body>
<!--Header-->
<%template src="_header.html"%>
<!--/Header-->
  
<div class="section clearfix">
  <div class="cart-box">
    <h1>确认订单信息</h1>
    <div class="cart-step">
      <ul>
        <li class="item"><span>1</span>放进购物车</li>
        <li class="selected"><span>2</span>填写订单信息</li>
        <li class="last"><span>3</span>支付/确定订单</li>
      </ul>
    </div>
  </div>
  
  <div class="line30"></div>
  <h3 class="bar-tit">1、收货地址</h3>
  
  <form id="orderForm" name="orderForm" url="{config.webpath}tools/submit_ajax.ashx?action=order_save&site={site.build_path}">
  <div class="form-box address-info">
    <dl>
      <dt>收货人姓名：</dt>
      <dd>
        <input name="book_id" id="book_id" type="hidden" value="0" />
        <input name="accept_name" id="accept_name" type="text" class="input txt wide" value="" datatype="s2-20" sucmsg=" " />
        <span class="Validform_checktip">*收货人姓名</span>
      </dd>
    </dl>
    <dl>
      <dt>所属地区：</dt>
      <dd>
        <select id="province" name="province" class="select"></select>
        <select id="city" name="city" class="select"></select>
        <select id="area" name="area" class="select" datatype="*" sucmsg=" "></select>
        <span class="Validform_checktip">*请选择您所在的地区</span>
      </dd>
    </dl>
    <dl>
      <dt>详细地址：</dt>
      <dd>
        <input name="address" id="address" type="text" class="input txt" value="" datatype="*2-100" sucmsg=" " style="width:300px;" />
        <span class="Validform_checktip">*除上面所属地区外的详细地址</span>
      </dd>
    </dl>
    <dl>
      <dt>手机号码：</dt>
      <dd>
        <input name="mobile" id="mobile" type="text" class="input txt" value="" datatype="m" sucmsg=" " />
        <span class="Validform_checktip">*收货人的手机号码</span>
      </dd>
    </dl>
    <dl>
      <dt>联系电话：</dt>
      <dd>
        <input name="telphone" id="telphone" type="text" class="input txt" value="" />
        <span class="Validform_checktip">收货人的联系电话，非必填</span>
      </dd>
    </dl>
    <dl>
      <dt>电子邮箱：</dt>
      <dd>
        <input name="email" id="email" type="text" class="input txt" value="" />
        <span class="Validform_checktip">方便通知订单状态，非必填</span>
      </dd>
    </dl>
    <dl>
      <dt>邮政编码：</dt>
      <dd>
        <input name="post_code" id="post_code" type="txt" class="input txt" />
        <span class="Validform_checktip">所在地区的邮政编码，非必填</span>
      </dd>
    </dl>
  </div>
  
  <div class="line30"></div>
  <h3 class="bar-tit">2、支付方式</h3>
  <ul class="item-box">
    <%set DataTable paymentList=get_payment_list(0, "is_lock=0")%> <!--取得一个DataTable-->
    <%loop dr1 paymentList%>
    <%set (decimal){poundage_amount}=get_payment_poundage_amount({strtoint({dr1[id]})},goodsTotal.real_amount)%>
    <li>
      <label>
      <%if(dr1__loop__id==(paymentList.Rows.Count))%>
        <input name="payment_id" type="radio" onclick="paymentAmountTotal(this);" value="{dr1[id]}" datatype="*" sucmsg=" " />
        <input name="payment_price" type="hidden" value="{poundage_amount}" />{dr1[title]}
      <%else%>
        <input name="payment_id" type="radio" onclick="paymentAmountTotal(this);" value="{dr1[id]}" />
        <input name="payment_price" type="hidden" value="{poundage_amount}" />{dr1[title]}
      <%/if%>
        <em>手续费：{poundage_amount}元</em>
      </label>
    </li>
    <%/loop%>
  </ul>
  
  <div class="line30"></div>
  <h3 class="bar-tit">3、配送方式</h3>
  <ul class="item-box">
    <%set DataTable expressList=get_express_list(0, "is_lock=0")%> <!--取得一个DataTable-->
    <%loop dr2 expressList%>
      <li>
        <label>
        <%if(dr2__loop__id==(expressList.Rows.Count))%>
          <input name="express_id" type="radio" onclick="freightAmountTotal(this);" value="{dr2[id]}" datatype="*" sucmsg=" " />
          <input name="express_price" type="hidden" value="{dr2[express_fee]}" />{dr2[title]}
        <%else%>
          <input name="express_id" type="radio" onclick="freightAmountTotal(this);" value="{dr2[id]}" />
          <input name="express_price" type="hidden" value="{dr2[express_fee]}" />{dr2[title]}
        <%/if%>
          <em>费用：{dr2[express_fee]}元</em>
        </label>
      </li>
    <%/loop%>
  </ul>
    
  <div class="line30"></div>
  <h3 class="bar-tit">4、商品清单</h3>
  <table width="100%" border="0" align="center" cellpadding="8" cellspacing="0" class="cart-table">
    <tr>
      <th colspan="2" align="left">商品信息</th>
      <th width="84" align="left">单价</th>
      <th width="84" align="left">优惠(元)</th>
      <th width="84" align="center">数量</th>
      <th width="104" align="left">金额(元)</th>
      <th width="84" align="left">积分</th>
      <th width="84" align="center">库存(件)</th>
    </tr>
    <%foreach(DTcms.Model.cart_items modelt in goodsList)%>
    <tr>
      <td width="68">
        <a target="_blank" href="<%linkurl("goods_show",{modelt.article_id})%>">
          <img src="{modelt.img_url}" class="img" />
        </a>
      </td>
      <td>
        <a target="_blank" href="<%linkurl("goods_show",{modelt.article_id})%>">{modelt.title}</a>
      </td>
      <td>
        <span class="red">
          ￥{modelt.user_price}
        </span>
      </td>
      <td>
        <span class="red">
          ￥<%=(modelt.sell_price-modelt.user_price)%>
        </span>
      </td>
      <td align="center">{modelt.quantity}</td>
      <td>
        <span class="red">
          ￥<%=(modelt.user_price*modelt.quantity)%>
        </span>
      </td>
      <td align="center">
        <%if(modelt.point>0)%>
          +
        <%/if%>
        <%=(modelt.point*modelt.quantity)%>
      </td>
      <td align="center">
        {modelt.stock_quantity}
      </td>
    </tr>
    <%/foreach%>
    <%if(goodsList.Count<1)%>
    <tr>
      <td colspan="8">
        <div class="msg-tips">
          <div class="ico warning"></div>
          <div class="msg">
            <strong>购物车没有商品！</strong>
            <p>您的购物车为空，<a href="<%linkurl("index")%>">马上去购物</a>吧！</p>
          </div>
        </div>
      </td>
    </tr>
    <%/if%>
  </table>
  
  <div class="line30"></div>
  <h3 class="bar-tit">5、结算信息</h3>
  <div class="buy-foot">
    <div class="left">
      <dl>
        <dd>
          <label><input name="is_invoice" id="is_invoice" type="checkbox" value="1" onclick="taxAmoutTotal(this);" /> 是否开具发票</label>
          <input name="taxAmout" id="taxAmout" type="hidden" value="<%=get_order_taxamount(goodsTotal.real_amount)%>" />
        </dd>
      </dl>
      <dl id="invoiceBox" style="display:none;">
        <dt>发票抬头(100字符以内)</dt>
        <dd>
           <input name="invoice_title" id="invoice_title" type="text" class="input" />
        </dd>
      </dl>
      <dl>
        <dt>订单备注(100字符以内)</dt>
        <dd>
          <textarea name="message" class="input" style="height:35px;"></textarea>
        </dd>
      </dl>
    </div>
    <div class="right">
      <p>
        商品 <label class="price">{goodsTotal.total_quantity}</label> 件&nbsp;&nbsp;&nbsp;&nbsp;
        商品金额：￥<label id="goodsAmount" class="price">{goodsTotal.real_amount}</label> 元&nbsp;&nbsp;&nbsp;&nbsp;
        总积分：<label class="price">{goodsTotal.total_point}</label> 分
      </p>
      <p>
        运费：￥<label id="expressFee" class="price">0.00</label> 元 +
        支付手续费：￥<label id="paymentFee" class="price">0.00</label> 元 +
        税费：￥<label id="taxesFee" class="price">0.00</label> 元
      </p>
      <p class="txt-box">
        应付总金额：￥<label id="totalAmount" class="price">{goodsTotal.real_amount}</label>
      </p>
      <p class="btn-box">
        <a class="btn" href="<%linkurl("cart")%>">返回购物车</a>
        <%if(goodsTotal.total_quantity>0)%>
        <input id="btnSubmit" name="btnSubmit" type="submit" value="确认提交" class="btn btn-success" />
        <%else%>
        <input id="btnSubmit" name="btnSubmit" type="button" value="确认提交" class="btn btn-gray" disabled="disabled" />
        <%/if%>
      </p>
    </div>
  </div>
  <div class="clear"></div>
  </form>
   
</div>

<!--Footer-->
<%template src="_footer.html"%>
<!--/Footer-->
</body>
</html>